package com.dhcc.crftool.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @Author deck
 * @Date 2020/3/2
 */

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "crf_mapping")
@ApiModel(value = "CRF表字段映射表")
public class CRFMapping extends Model<CRFMapping> {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "id")
    @TableField("id")
    private Integer id;

    @ApiModelProperty(value = "源表字段名称")
    @TableField("source_name")
    private String sourceName;

    @ApiModelProperty(value = "表单id")
    @TableField("form_id")
    private String formId;

    @ApiModelProperty(value = "新版CRF中的字段名称")
    @TableField("target_name")
    private String targetName;

    @ApiModelProperty(value = "原系统类型，EDC或CSM")
    @TableField("source_type")
    private String sourceType;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
